import * as PopupMenu from './popupMenu.js';
import {ensureActorVisibleInScrollView} from '../misc/animationUtils.js';
-import {formatDateWithCFormatString, formatTimeSpan} from '../misc/dateUtils.js';
+import {formatDateWithCFormatString} from '../misc/dateUtils.js';
import {loadInterfaceXML} from '../misc/fileUtils.js';
const SHOW_WEEKDATE_KEY = 'show-weekdate';
this.setUseBodyMarkup(notification.bannerBodyMarkup);
this.notification = notification;
+ this.datetime = notification.datetime;
this.setIcon(this._getIcon());
}
_onUpdated(n, _clear) {
+ this.datetime = n.datetime;
this.setIcon(this._getIcon());
this.setTitle(n.title);
this.setBody(n.bannerBodyText);
}
});
-const TimeLabel = GObject.registerClass(
-class NotificationTimeLabel extends St.Label {
- _init(datetime) {
- super._init({
- style_class: 'event-time',
- x_align: Clutter.ActorAlign.START,
- y_align: Clutter.ActorAlign.END,
- x_expand: true,
- });
- this._datetime = datetime;
- }
-
- vfunc_map() {
- this.text = formatTimeSpan(this._datetime);
- super.vfunc_map();
- }
-});
-
const NotificationSection = GObject.registerClass(
class NotificationSection extends MessageList.MessageListSection {
_init() {
_onNotificationAdded(source, notification) {
let message = new NotificationMessage(notification);
- message.setSecondaryActor(new TimeLabel(notification.datetime));
let isUrgent = notification.urgency === MessageTray.Urgency.CRITICAL;
this._nUrgent--;
},
'updated', () => {
- message.setSecondaryActor(new TimeLabel(notification.datetime));
this.moveMessage(message, isUrgent ? 0 : this._nUrgent, this.mapped);
}, this);